import request from '@/plugin/axios'


export function getDictTypeList(params) {
    return request({
        url: '/bdms/dicttype/list',
        method: 'get',
        params: request.adornParams(params)
    })
}

export function getDictType(id) {
    return request({
        url: '/bdms/dicttype/info/' + id,
        method: 'get',
    })
}

// 复制字典
export function dictcopy(params) {
    return request({
        url: '/bdms/dicttype/copyDict',
        method: 'post',
        data: request.adornData(params, false)
    })
}


export function delBatchDictType(ids) {
    return request({
        url: '/bdms/dicttype/delete',
        method: 'post',
        data: request.adornData(ids, false)
    })
}

export function getChildren(params) {
    return request({
        url: '/bdms/dicttype/children',
        method: 'get',
        params: request.adornParams(params)
    })
}
export function getValues(type) {
    return request({
        url: '/bdms/dicttype/values/' + type,
        method: 'get',
        params: request.adornParams({})
    })
}
export function saveDictType(data) {
    return request({
        url: '/bdms/dicttype/save',
        method: 'post',
        data
    })
}

export function updateDictType(data) {
    return request({
        url: '/bdms/dicttype/update',
        method: 'put',
        data: data
    })
}
export function delDictType(id) {
    return request({
        url: '/bdms/dicttype/delete/' + id,
        method: 'delete',
    })
}

// 字典项管理

export function saveDictValue(data) {
    return request({
        url: '/bdms/dictvalue/save',
        method: 'post',
        data
    })
}

export function updateDictValue(data) {
    return request({
        url: '/bdms/dictvalue/update',
        method: 'put',
        data: data
    })
}

export function getDictValue(id) {
    return request({
        url: '/bdms/dictvalue/info/' + id,
        method: 'get',
    })
}

export function delDictValue(id) {
    return request({
        url: '/bdms/dictvalue/delete/' + id,
        method: 'delete',
    })
}